package com.lihao.sam.controller;

import com.lihao.sam.entity.Company;
import com.lihao.sam.entity.EmpScore;
import com.lihao.sam.service.intf.CompanyService;
import com.lihao.sam.service.intf.EmpScoreService;
import com.lihao.sam.vo.PageVo;
import com.lihao.sam.vo.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

/**
 * @Author LiHao
 * @Description EmpScoreController
 * @Date 13:10 2022/11/22
 */
@RestController
@RequestMapping("/api/empscore/")
public class EmpScoreController {
    @Resource
    private EmpScoreService service;

    @PostMapping("add.do")
    public R add(EmpScore empScore) {
        return service.add(empScore);
    }

    @PostMapping("update.do")
    public R update(EmpScore empScore) {
        return service.update(empScore);
    }

    @PostMapping("delete.do")
    public R delete(int id, HttpSession session) {
        return service.delete(id);
    }

    @GetMapping("page.do")
    public PageVo page(int page, int limit, String rule, Integer score) {
        return service.queryPage(page, limit, rule, score);
    }
    @PostMapping("deletebatch.do")
    public R deleteBatch(int[] ids) {
        return service.deleteBatch(ids);
    }
}
